package cn.rwklyd.ecommerce.service;

import cn.rwklyd.ecommerce.mapper.UserLogMapper;
import cn.rwklyd.ecommerce.pojo.UserLog;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Service
public class UserLogService {
    @Autowired
    private UserLogMapper userLogMapper;

    @Transactional(propagation = Propagation.REQUIRES_NEW)  // 开启新事务,防止加入删除的事务中，保证日志有效记录不被回滚
    public void insert(UserLog userLog) {
        userLogMapper.insert(userLog
        );
    }

}
